﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using GeekShop.Properties;

namespace GeekShop.Commands.Select
{
    public class Rectangle : ICommand
    {
        #region Fields
        private Picture picture;
        private Region region;
        private Region oldRegion;
        #endregion

        #region Contrustor
        public Rectangle(Picture picture, Region region)
        {
            this.picture = picture;
            this.region = region;
        }
        #endregion

        #region ICommand Members
        public void Do()
        {
            this.oldRegion = (Region)this.picture.Mask.Region.Clone();
            this.picture.Mask.Region = this.region;
        }
        public void Undo()
        {
            this.picture.Mask.Region = this.oldRegion;
        }
        #endregion
    }
}
